package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 林地指标交易平台_交易申请发票管理 实体类。
 *
 * @author 11987
 * @since 2025-06-04
 */
@Table(value = "LINDI_TRADE_APPLICATION_INVOICE", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiTradeApplicationInvoice extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 发票ID
     */
    private Long invoiceId;

    /**
     * 交易申请ID
     */
    private Long tradeApplicationId;

    /**
     * 发票文件ID
     */
    private Long invoiceFileId;

    /**
     * 发票编号
     */
    private String invoiceNumber;

    /**
     * 发票类型
     */
    private String invoiceType;

    /**
     * 发票金额
     */
    private String invoiceMoney;

    /**
     * 开票日期
     */
    private LocalDateTime invoiceDate;

    // 无参构造函数
    public LindiTradeApplicationInvoice() {
    }

    // 全参构造函数
    public LindiTradeApplicationInvoice(Long invoiceId, Long tradeApplicationId, Long invoiceFileId, String invoiceNumber, String invoiceType, String invoiceMoney, LocalDateTime invoiceDate) {
        this.invoiceId = invoiceId;
        this.tradeApplicationId = tradeApplicationId;
        this.invoiceFileId = invoiceFileId;
        this.invoiceNumber = invoiceNumber;
        this.invoiceType = invoiceType;
        this.invoiceMoney = invoiceMoney;
        this.invoiceDate = invoiceDate;
    }

    // Getter和Setter方法
    public Long getInvoiceId() {
        return invoiceId;
    }

    public void setInvoiceId(Long invoiceId) {
        this.invoiceId = invoiceId;
    }

    public Long getTradeApplicationId() {
        return tradeApplicationId;
    }

    public void setTradeApplicationId(Long tradeApplicationId) {
        this.tradeApplicationId = tradeApplicationId;
    }

    public Long getInvoiceFileId() {
        return invoiceFileId;
    }

    public void setInvoiceFileId(Long invoiceFileId) {
        this.invoiceFileId = invoiceFileId;
    }

    public String getInvoiceNumber() {
        return invoiceNumber;
    }

    public void setInvoiceNumber(String invoiceNumber) {
        this.invoiceNumber = invoiceNumber;
    }

    public String getInvoiceType() {
        return invoiceType;
    }

    public void setInvoiceType(String invoiceType) {
        this.invoiceType = invoiceType;
    }

    public String getInvoiceMoney() {
        return invoiceMoney;
    }

    public void setInvoiceMoney(String invoiceMoney) {
        this.invoiceMoney = invoiceMoney;
    }

    public LocalDateTime getInvoiceDate() {
        return invoiceDate;
    }

    public void setInvoiceDate(LocalDateTime invoiceDate) {
        this.invoiceDate = invoiceDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LindiTradeApplicationInvoice that = (LindiTradeApplicationInvoice) o;
        return java.util.Objects.equals(invoiceId, that.invoiceId) &&
               java.util.Objects.equals(tradeApplicationId, that.tradeApplicationId) &&
               java.util.Objects.equals(invoiceFileId, that.invoiceFileId) &&
               java.util.Objects.equals(invoiceNumber, that.invoiceNumber) &&
               java.util.Objects.equals(invoiceType, that.invoiceType) &&
               java.util.Objects.equals(invoiceMoney, that.invoiceMoney) &&
               java.util.Objects.equals(invoiceDate, that.invoiceDate);
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(super.hashCode(), invoiceId, tradeApplicationId, invoiceFileId, invoiceNumber, invoiceType, invoiceMoney, invoiceDate);
    }

    @Override
    public String toString() {
        return "LindiTradeApplicationInvoice{" +
               "invoiceId=" + invoiceId +
               ", tradeApplicationId=" + tradeApplicationId +
               ", invoiceFileId=" + invoiceFileId +
               ", invoiceNumber='" + invoiceNumber + '\'' +
               ", invoiceType='" + invoiceType + '\'' +
               ", invoiceMoney='" + invoiceMoney + '\'' +
               ", invoiceDate=" + invoiceDate +
               "} " + super.toString();
    }

    // Builder类
    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private Long invoiceId;
        private Long tradeApplicationId;
        private Long invoiceFileId;
        private String invoiceNumber;
        private String invoiceType;
        private String invoiceMoney;
        private LocalDateTime invoiceDate;

        public Builder invoiceId(Long invoiceId) {
            this.invoiceId = invoiceId;
            return this;
        }

        public Builder tradeApplicationId(Long tradeApplicationId) {
            this.tradeApplicationId = tradeApplicationId;
            return this;
        }

        public Builder invoiceFileId(Long invoiceFileId) {
            this.invoiceFileId = invoiceFileId;
            return this;
        }

        public Builder invoiceNumber(String invoiceNumber) {
            this.invoiceNumber = invoiceNumber;
            return this;
        }

        public Builder invoiceType(String invoiceType) {
            this.invoiceType = invoiceType;
            return this;
        }

        public Builder invoiceMoney(String invoiceMoney) {
            this.invoiceMoney = invoiceMoney;
            return this;
        }

        public Builder invoiceDate(LocalDateTime invoiceDate) {
            this.invoiceDate = invoiceDate;
            return this;
        }

        public LindiTradeApplicationInvoice build() {
            return new LindiTradeApplicationInvoice(invoiceId, tradeApplicationId, invoiceFileId, invoiceNumber, invoiceType, invoiceMoney, invoiceDate);
        }
    }

}
